<template>
  <div class="plus-and-minus-buttons">
    <div :disabled="minusDisabled" @click="decremental">-</div>
    <p>{{ count }}</p>
    <div :disabled="plusDisabled" @click="incremental">+</div>
  </div>
</template>

<script>
export default {
  name: "PlusAndMinusButtons",
  props: {
    count: {
      type: Number,
      default: 1
    },
    minusDisabled: {
      type: Boolean,
      default: false
    },
    plusDisabled: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    decremental() {
      this.$emit("decremental");
    },
    incremental() {
      this.$emit("incremental");
    }
  }
}
</script>

<style scoped>
.plus-and-minus-buttons {
  text-align: center;
  display: flex;
  line-height: 20px;
}

.plus-and-minus-buttons p {
  color: #000;
  text-align: center;
  width: 30px;
  font-size: 12px;
  background-color: rgba(180, 180, 180, .1);
  margin: 0 1px;
}

.plus-and-minus-buttons div {
  width: 30px;
  color: #adadad;
  border: none;
  background-color: rgba(100, 100, 100, .1);
  pointer-events: auto;
}

.plus-and-minus-buttons div[disabled] {
  pointer-events: none;
  color: #999999;
  background-color: rgba(180, 180, 180, .1);
}
</style>